package com.itheima.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {
    private Integer code;
    private String msg;
    private Object data;
public static R ok(){
    R r=new R();
    r.setCode(1);
    return r;
}
    public static R ok(Object data){
        R r=new R();
        r.data=data;
        r.setCode(1);
        return r;
    }

    public static R error(String msg){
        R r=new R();
        r.setMsg(msg);
        r.setCode(0);
        return r;
    }
}
